package com.ruoyi.user.controller;


import com.ruoyi.common.core.domain.R;
//import com.ruoyi.user.domain.SysUserRole;
import com.ruoyi.user.domain.SysUserRole;
import com.ruoyi.user.service.ISysUserRoleService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

@RestController
@RequestMapping("/userRole")
public class SysUserRoleController {

    @Autowired
    private ISysUserRoleService sysUserRoleService;

    @PostMapping("/add")
    public R add(@RequestBody SysUserRole sysUserRole){
        int i = sysUserRoleService.insertSysUserRole(sysUserRole);
        if(i > 0){
            return R.ok("为用户创建角色成功");
        }
        return R.fail("为用户创建角色失败");
    }
}
